#include "gameobject.h"

BaseObject::BaseObject()
{
	mSymbol = '#';
	mPosition = sf::Vector2<float>(0.0f, 0.0f);
	mSolid = false;
	mColour = sf::Color(180, 180, 180);
}

void BaseObject::setSymbol(char symbol)
{
	mSymbol = symbol;
}

void BaseObject::setPosition(sf::Vector2<float> position)
{
	mPosition = position;
}

void BaseObject::draw(sf::RenderWindow& context)
{
	context.Draw(mASM.getSymbol(mSymbol, mPosition, mColour));
}

void BaseObject::setSolid(bool solid)
{
	mSolid = solid;
}

Door::Door()
{
	mSymbol = '+';
	mSolid = true;
	mColour = sf::Color(160, 100, 60);
}

Wall::Wall()
{
	mSymbol = '#';
	mSolid = true;
	mColour = sf::Color(80, 80, 80);
}

Dirt::Dirt()
{
	switch(sf::Randomizer::Random(0, 3))
	{
	case(0):
		mSymbol = ' ';
		break;
	case(1):
		mSymbol = '.';
		break;
	case(2):
		mSymbol = ',';
		break;
	case(3):
		mSymbol = '\'';
		break;
	default:
#ifdef DEBUG
		printf("Dirt floor randomiser out of bounds, defaulting\n");
#endif
		mSymbol = '.';
		break;
	}

	mSolid = false;
	mColour = sf::Color(sf::Randomizer::Random(60,80), sf::Randomizer::Random(40,60), sf::Randomizer::Random(20,40));
}